import matplotlib.pyplot as plt
import numpy as np

# Data
categories = ['USA', 'China']
records = [264, 204]
coefficients_usa = [-1.34779303, 8.47899847]
coefficients_china = [17.69535234, -6.00355119]
intercepts = [16.617545209486785, 32.22479835548003]
coach_change_effects = [-1.34779302903174, 17.695352338369975]
#比赛结束前最后一天售后群发布无水印可视化结果+无标注代码【可直接提交】为了防止倒卖， 论文写作过程中遗留数个致命问题，无关代码，该问题解决方式仅在官网授权售后群答疑，盗卖方式购买资料不提供答疑，感谢理解 美赛资料助攻购买链接+说明https://docs.qq.com/doc/p/f3dc6bffbf4dab58dbdfd3e5e5de18a2ad974216
# Visualization
fig, axs = plt.subplots(2, 2, figsize=(12, 10))
fig.suptitle('USA vs China Analysis', fontsize=16)

# Number of records bar chart
axs[0, 0].bar(categories, records, color=['blue', 'red'])
axs[0, 0].set_title('Number of Records')#比赛结束前最后一天售后群发布无水印可视化结果+无标注代码【可直接提交】为了防止倒卖， 论文写作过程中遗留数个致命问题，无关代码，该问题解决方式仅在官网授权售后群答疑，盗卖方式购买资料不提供答疑，感谢理解 美赛资料助攻购买链接+说明https://docs.qq.com/doc/p/f3dc6bffbf4dab58dbdfd3e5e5de18a2ad974216
axs[0, 0].set_ylabel('Count')

# Coefficients bar chart
x = np.arange(len(coefficients_usa))
width = 0.35
axs[0, 1].bar(x - width/2, coefficients_usa, width, label='USA', color='blue')
axs[0, 1].bar(x + width/2, coefficients_china, width, label='China', color='red')
axs[0, 1].set_xticks(x)
axs[0, 1].set_xticklabels(['Coefficient 1', 'Coefficient 2'])
axs[0, 1].set_title('Model Coefficients')
axs[0, 1].legend()

# Intercepts comparison
axs[1, 0].bar(categories, intercepts, color=['blue', 'red'])#比赛结束前最后一天售后群发布无水印可视化结果+无标注代码【可直接提交】为了防止倒卖， 论文写作过程中遗留数个致命问题，无关代码，该问题解决方式仅在官网授权售后群答疑，盗卖方式购买资料不提供答疑，感谢理解 美赛资料助攻购买链接+说明https://docs.qq.com/doc/p/f3dc6bffbf4dab58dbdfd3e5e5de18a2ad974216
axs[1, 0].set_title('Model Intercepts')
axs[1, 0].set_ylabel('Intercept Value')

# Coach change effect comparison
axs[1, 1].bar(categories, coach_change_effects, color=['blue', 'red'])
axs[1, 1].set_title('Coach Change Effect')
axs[1, 1].set_ylabel('Effect Value')

plt.tight_layout(rect=[0, 0, 1, 0.96])
plt.show()
